//
//  YBSearchCell.m
//  Cocoachina
//
//  Created by 游兵 on 2017/9/16.
//  Copyright © 2017年 YBing. All rights reserved.
//

#import "YBSearchCell.h"

@implementation YBSearchCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setNews:(YBNews *)news
{
    _news = news;
//    self.titleLabel.text = news.title;
    
    NSString * htmlString = [NSString stringWithFormat:@"<span style=\"font-size:16px;\">%@</span>", news.title];
    NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
    self.titleLabel.attributedText = attrStr;
    
    self.descLabel.text = news.desc;
    
    NSAttributedString * desc = [[NSAttributedString alloc] initWithData:[news.desc dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
    self.descLabel.attributedText = desc;
    
    self.timeLabel.text = news.time;
    self.readnumLabel.text = news.readnum;
}
@end
